﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace RuoVea.ExConfig.Options;

/// <summary>
/// 扩展
/// </summary>
public static class ConfigExtensions
{
    /// <summary>
    /// 配置文件注入
    /// </summary>
    /// <param name="services">服务</param>
    /// <param name="exoptions">参数</param>
    public static void ExConfigInject(this IServiceCollection services, ConfigSettingsOptions exoptions)
    {
        Appsettings.Configure(exoptions);
    }

    /// <summary>
    /// 配置文件注入
    /// </summary>
    /// <param name="services">服务</param>
    /// <param name="sections">参数</param>
    public static void ExConfigInject(this IServiceCollection services, IConfigurationSection sections)
    {
        Appsettings.Configure(sections);
    }
}
